-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xodex support #5406
base: x
Are you sure you want to change the base?
xodex support #5406
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
PR Summary
|
Walkthrough本次更改涉及在网络配置中引入新的网络短代码和网络配置,具体包括添加新的网络短代码 Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- packages/shared/src/config/networkIds.ts (1 hunks)
- packages/shared/src/config/presetNetworks.ts (3 hunks)
- packages/shared/types/swap/SwapProvider.constants.ts (1 hunks)
Additional comments not posted (3)
packages/shared/src/config/networkIds.ts (1)
14-14
: 看起来不错!添加新的网络短代码
'xodex'
到INetworkShortCode
类型是合理的改动。这个改动扩展了类型的灵活性,以适应未来可能需要集成或支持 xodex 网络的功能。新增的标识符与现有的命名约定保持一致,不会引入任何明显的问题或不一致。packages/shared/src/config/presetNetworks.ts (2)
147-185
: 代码看起来不错!新增的
xodexTestnet
网络配置对象的属性设置正确,符合IServerNetwork
接口的定义。将isTestnet
设为true
正确标识了这是一个测试网络。
187-225
: 主网配置看起来正确!新增的
xodex
主网配置与之前的xodexTestnet
测试网配置大部分属性一致,区别在于chainId
和isTestnet
。将isTestnet
设为false
正确标识了这是一个主网。
'evm--2415': { | ||
fromToken: { | ||
'networkId': 'evm--2415', | ||
'contractAddress': '', | ||
'name': 'Xodex', | ||
'symbol': 'xodex', | ||
'decimals': 18, | ||
'logoURI': | ||
'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', | ||
|
||
'isNative': true, | ||
}, | ||
toToken: { | ||
'networkId': 'evm--2415', | ||
'contractAddress': '0x04068da6c83afcfa0e13ba15a6696662335d5b75', | ||
'name': 'USD Coin', | ||
'symbol': 'USDC', | ||
'decimals': 6, | ||
'logoURI': | ||
'https://uni-test.onekey-asset.com/server-service-onchain/evm--250/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png', | ||
'isNative': false, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加 'evm--2415' 网络的代币交换配置看起来不错!
但是请注意,'toToken'(USD Coin)的 logoURI
当前指向了 'evm--250' 网络的代币图标。为了保持一致性和正确性,请确保使用 'evm--2415' 网络特定的 USD Coin 图标 URL。
建议将 'toToken' 的 logoURI
更新为:
- 'logoURI':
- 'https://uni-test.onekey-asset.com/server-service-onchain/evm--250/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png',
+ 'logoURI':
+ 'https://uni-test.onekey-asset.com/server-service-onchain/evm--2415/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png',
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'evm--2415': { | |
fromToken: { | |
'networkId': 'evm--2415', | |
'contractAddress': '', | |
'name': 'Xodex', | |
'symbol': 'xodex', | |
'decimals': 18, | |
'logoURI': | |
'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', | |
'isNative': true, | |
}, | |
toToken: { | |
'networkId': 'evm--2415', | |
'contractAddress': '0x04068da6c83afcfa0e13ba15a6696662335d5b75', | |
'name': 'USD Coin', | |
'symbol': 'USDC', | |
'decimals': 6, | |
'logoURI': | |
'https://uni-test.onekey-asset.com/server-service-onchain/evm--250/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png', | |
'isNative': false, | |
}, | |
}, | |
'evm--2415': { | |
fromToken: { | |
'networkId': 'evm--2415', | |
'contractAddress': '', | |
'name': 'Xodex', | |
'symbol': 'xodex', | |
'decimals': 18, | |
'logoURI': | |
'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', | |
'isNative': true, | |
}, | |
toToken: { | |
'networkId': 'evm--2415', | |
'contractAddress': '0x04068da6c83afcfa0e13ba15a6696662335d5b75', | |
'name': 'USD Coin', | |
'symbol': 'USDC', | |
'decimals': 6, | |
'logoURI': | |
'https://uni-test.onekey-asset.com/server-service-onchain/evm--2415/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png', | |
'isNative': false, | |
}, | |
}, |
Summary by CodeRabbit
新功能
'xodex'
,支持更多网络标识符。xodexTestnet
和xodex
,支持主网和测试网的功能。evm--2415
网络上进行 Xodex 和 USD Coin 的代币互换。文档